package com.common.handler;

import com.client.common.vo.ClientResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author dzh
 * @date 2023/1/9 10:16
 */
@RestControllerAdvice
@Slf4j
public class CommonRestControllerAdvice {

    @ExceptionHandler({IllegalArgumentException.class})
    public ClientResult<Object> illegalArgumentException(IllegalArgumentException e) {
        log.warn("illegalArgumentException", e);
        return ClientResult.makeFail("参数异常");
    }
}
